package cn.kgc.househou.service;

import cn.kgc.househou.mapper.HouseinfoMapper;
import cn.kgc.househou.pojo.Houseinfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class HousetypeinfoServiceImpl implements HousetypeinfoService {

    @Resource
    HouseinfoMapper houseinfoMapper;
    @Override
    public PageInfo<Houseinfo> sele(Integer pageNum) {
        PageHelper.startPage(pageNum,2);
        List<Houseinfo> houseinfos = houseinfoMapper.selectByExample(null);
        PageInfo<Houseinfo> pageInfo=new PageInfo<>(houseinfos);
        return pageInfo;
    }

    @Override
    public Integer addHouseInfo(Houseinfo houseinfo) {
        return houseinfoMapper.insert(houseinfo);
    }
}
